from django.apps import AppConfig


class AdministratorsConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'administrators'

    def ready(self):

        from django.core.cache import cache

        # 创建一个字典，专门用于存放所有已经登录人员的缓存
        cache.set('user', {1: {'username': '谢佩恒', 'password': 'xph'}}, None)
        # print('用户缓存：', {1: {'username': '谢佩恒', 'password': 'xph'}})
        # print(f'{self.name} 应用缓存加载完毕')
